Get Previous selected Object while using trigger

Hi All,

I am working on a object level trigger.When i use the pre/post trigger for sync/open event i am able to get the id of current object that the user is going to select or open.

I need to find out the object id, that the user has edited/opened while he leaves the object, so that i can give a message to the user saying that the updated object has empty value for some mandatory field. Please help me in this regard.

Regards
Sunil
asunilkumar - Wed Jun 06 09:55:07 EDT 2012

Re: Get Previous selected Object while using trigger
llandale - Wed Jun 06 16:50:00 EDT 2012

I'm pretty sure in a pre-sync-object trigger:

  • Object objNext = object(trg) // Object just selected by user
  • Object objCurr = current() // Object we are moving away from; but haven't yet since this is a "pre" trigger.

This seems to work from an open module:

bool  DoTrig(Trigger trg, string Message)
{    
        Object oNext = object(trg)
        Object oCurr = current
        print Message "\tCurr/Next = " identifier(oCurr) "\t" identifier(oNext) "\n"
        return(true)
}
 
bool    clbkTrigOpen(Trigger trg)
{     DoTrig(trg, "OpenTrig")
        return(true)
}
bool    clbkTrigSync(Trigger trg)
{     DoTrig(trg, "SyncTrig")
        return(true)
}
 
trigger(module->object, open, 3, clbkTrigOpen)
trigger(module->object, sync, 6, clbkTrigSync)

 


-Louie